package com.richapp.launcher.database.system.dao;

import java.util.List;

import android.content.Context;
import android.util.Log;

import com.richapp.launcher.database.system.SystemBaseDao;
import com.richapp.launcher.database.system.mode.SystemValueModel;

public class SystemValueModelDao extends SystemBaseDao<SystemValueModel>{

	public SystemValueModelDao(Context context) {
		super(context,SystemValueModel.class);
	}
	
	public List<SystemValueModel> getList(){
		List<SystemValueModel> list = null;
		try {
			list = gettOp().queryBuilder().query();
		} catch (Exception e) {
			Log.e(getClass().getName(), e.getMessage());
		}
		return list;
	}
	
	public SystemValueModel getByName(String boxCpuId ,String name){
		SystemValueModel svm = null;
		try {
			svm = gettOp().queryBuilder().where().eq("name", name).and().eq("boxCpuId",boxCpuId).queryForFirst();
		} catch (Exception e) {
			Log.e(getClass().getName(), e.getMessage());
		}
		return svm;
	}
}
